<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGridPlanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('grid_plan', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('grid_id')->default(0)->comment('网格id');
            $table->integer('type')->default(0)->comment('1面积确认数据2测绘数据');
            $table->decimal('use_area', 10,2)->default(0)->comment('土地使用面积');
            $table->decimal('build_area', 10,2)->default(0)->comment('房屋建筑面积');
            $table->decimal('two_area', 10,2)->default(0)->comment('二层及以上面积');
            $table->decimal('yard_area', 10,2)->default(0)->comment('院落面积');
            $table->decimal('public_area', 10,2)->default(0)->comment('公摊面积');
            $table->decimal('supply_area', 10,2)->default(0)->comment('应补偿面积');
            $table->decimal('dualuse_area', 10,2)->default(0)->comment('兼用面积');
            $table->decimal('reward_area', 10,2)->default(0)->comment('奖励面积');
            $table->decimal('improve_area', 10,2)->default(0)->comment('改善面积');
            $table->decimal('lack_area', 10,2)->default(0)->comment('不足45㎡面积');
            $table->decimal('basement_area', 10,2)->default(0)->comment('附属地下室建筑面积');
            $table->decimal('country_area', 10,2)->default(0)->comment('国有面积');
            $table->decimal('collective_area', 10,2)->default(0)->comment('集体面积');
            $table->integer('do_user_id')->default(0)->comment('操作者id');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `grid_plan` comment '拆分网格表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('grid_plan');
    }
}
